<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>JavaScript while循环的简单应用</title>
    </head>
    <body>
        <h3>JavaScript while循环的简单应用</h3>
        <hr />
        <p>
            使用while循环计算1+2+3+...+10的总和。
        </p>
        <script>
		var i = 1;
		var sum = 0;
		while(i<=10){
			sum += i;
			i++;
		}
		alert("运算结果是："+sum);
        </script>
    </body>
</html>